Skip to content

Fix #4978: Complete imported symbol in REPL #4979

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

Duhemm
Copy link
Contributor

@Duhemm Duhemm commented Aug 21, 2018

The first scenario described in #4978 is fixed by this PR. Fixing the second case (completion of renamed imports) requires #4977.

@@ -94,13 +94,22 @@ object Interactive {
private def safely[T](op: => List[T]): List[T] =
try op catch { case ex: TypeError => Nil }

private def addExtraImports(extraImports: List[untpd.Import], ctx: Context): Context = {
extraImports.foldLeft(ctx) { case (c, i) => c.importContext(i, i.symbol(c)) }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.symbol on untyped tree?

@allanrenucci
Copy link
Contributor

I have an alternative fix in #4915: the REPL make sure to call completions with a context that is aware of the imports and contextOfPath then use this context as a base (instead of the run context) for the newly computed context

@allanrenucci
Copy link
Contributor

Closed in favour of #4915

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants